//
//  ShowUserSearchTableViewCell.m
//  Taste
//
//  Created by 徐昊 on 16/9/23.
//  Copyright © 2016年 徐昊. All rights reserved.
//

#import "ShowUserSearchTableViewCell.h"
#import "UIImageView+WebCache.h"
#import "HXMacro.h"
#import "NSString+Vali.h"
#import "ShowUserSearchRes.h"

@interface ShowUserSearchTableViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *pic;
@property (weak, nonatomic) IBOutlet UILabel *nickName;
@property (weak, nonatomic) IBOutlet UIButton *concern;

@end

@implementation ShowUserSearchTableViewCell

- (void)setRes:(ShowUserSearchRes *)res {
    _res = res;
    [_pic sd_setImageWithURL:[NSURL URLWithString:[NSString imageWebWithStr:_res.headimg]] placeholderImage:[UIImage imageNamed:@"IMG_Universal_Placeholder_Avatar"] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
        
    }];
    _nickName.text = _res.nickname;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [self layoutIfNeeded];
    _pic.layer.masksToBounds = YES;
    _pic.layer.cornerRadius = _pic.bounds.size.width / 2;
    _pic.contentMode = UIViewContentModeScaleAspectFill;
    _concern.layer.masksToBounds = YES;
    _concern.layer.cornerRadius = 5;
    _concern.layer.borderWidth = 0.5;
    _concern.layer.borderColor = [UIColor blackColor].CGColor;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
